package com.zhengaz.common.core.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Objects;

/**
 * 分页请求实体
 *
 * @author zhengzg
 * @create 2023-09-07 17:52
 */
@Data
@ApiModel("分页请求实体")
public class PageDto {

    @ApiModelProperty("条数")
    private Integer pageSize;

    @ApiModelProperty("页数")
    private Integer pageNum;

    public void setPageSize(Integer pageSize) {
        this.pageSize = Objects.isNull(pageSize) || pageSize <= 0 ? 10 : pageSize;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = Objects.isNull(pageNum) || pageNum <= 0 ? 1 : pageNum;
    }
}
